﻿Shader "My/Glass"
{
    SubShader
    {
        Tags { "Queue"="Transparent" }

        Pass
        {
			ZTest Always
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag
            #include "UnityCG.cginc"

            struct appdata
            {
                float4 vertex : POSITION;
                float2 uv : TEXCOORD0;
            };

            struct v2f
            {
                float4 vertex : SV_POSITION;
				float4 uvgrab : TEXCOORD1;
            };

            sampler2D _BlurTex;
            v2f vert (appdata v)
            {
                v2f o;
                o.vertex = UnityObjectToClipPos(v.vertex);
				o.uvgrab = ComputeGrabScreenPos(o.vertex);
                return o;
            }

            fixed4 frag (v2f i) : SV_Target
            {
				fixed4 col = tex2Dproj(_BlurTex, UNITY_PROJ_COORD(i.uvgrab));
                return col;
            }
            ENDCG
        }
    }
}
